package com.tang;

import com.tang.user.User;
import com.tang.user.impl.Student;
import com.tang.user.impl.Teacher;
import com.tang.visitor.IVisitorService;

import java.util.ArrayList;
import java.util.List;

public class DataView {

    List<User> userList = new ArrayList<>();

    public DataView() {
        userList.add(new Student("谢飞机", "普通班", "二年级二班"));
        userList.add(new Student("付麒麟", "小A班", "六年级一班"));
        userList.add(new Student("付钟", "大A班", "五年级三班"));
        userList.add(new Student("李雯彦", "清北班", "三年级二班"));
        userList.add(new Teacher("陈老师", "特级教师", "五年级一班"));
        userList.add(new Teacher("周老师", "国家宝藏教师", "一年级一班"));
        userList.add(new Teacher("杨老师", "普通教师", "五年级一班"));
    }

    public void show(IVisitorService visitor) {
        for (User user : userList) {
            user.accept(visitor);
        }
    }

}
